GemaCoreLib
The GeMA Core library
Loading...
Searching...
No Matches
GmProcess Class Referenceabstract

Base interface class for Process type plugins. More...

#include <gmProcess.h>

Inheritance diagram for GmProcess:
Collaboration diagram for GmProcess:

Public Member Functions

 GmProcess (GmSimulationData *simulation, QString id, QString description, const GmLogCategory &logger)
 Constructor.
 
virtual ~GmProcess ()
 Virtual destructor.
 
virtual const char * pluginCategory () const
 Returns the plugin category.
 
virtual bool loadPrivateData (LuaTable &table)
 In general, processes dont have any configuration data on the simulation file.
 
virtual void printParameters (const GmLogCategory &logger)
 Asks the process to print all of its parameters using the provided logger.
 
virtual void loadFunctions (LuaTable &table)=0
 Virtual function that should be implemented by plugins to fill table with the set of functions exported by this process object.
 
virtual QStringList functionList () const =0
 Returns the set of function names exported by this process object.
 
int createProgressStatsItem (GmRunProgressStats *ps, const char *name)
 Creates the method process item. If needed, also creates the process item. Returns the new item id or -2 on error (uses -2 to report an error, instead of -1, to simplify the logic used to control creation and also to avoid multiple retries on further calls to a process method)
 
- Public Member Functions inherited from GmPluginObject
 GmPluginObject (GmSimulationData *simulation, QString id, QString description, const GmLogCategory &logger)
 Constructor.
 
virtual ~GmPluginObject ()
 Destructor.
 
QString id () const
 Returns the object id.
 
QString description () const
 Returns the object description.
 
QString pluginTypeName () const
 Returns the hierarchical type name for the plugin object type. See also pluginName() and pluginType().
 
virtual const char * pluginName () const =0
 Returns a string identifying the plugin which implements this object. Should return the SAME string as the one read from the plugin information file in the pluginName field.
 
virtual const char * pluginType () const =0
 Returns the string identifying the plugin object type. Should return the SAME string as the one read from the plugin information file in the objectTypes table.
 

Protected Member Functions

template<class T >
void registerFunctions (LuaTable &table, typename GmProcessMethodRedirector< T >::MethodRegistry *methods, bool noProgressStats=false)
 Helper function to make it very easy to implement loadFunctions()
 
template<class T >
QStringList buildFunctionList (typename GmProcessMethodRedirector< T >::MethodRegistry *methods) const
 Helper function to make it very easy to implement functionList() and keep it consistent with loadFunctions().
 
- Protected Member Functions inherited from GmPluginObject
virtual const GmLogCategorylogger () const
 Returns the internal logger used by the plugin to emmit messages.
 
GmSimulationDatasimulationData () const
 Returns a reference to the simulation data object keeping global simulation information.
 

Private Attributes

int _processProgressItem
 The root progress stats item related to this process.
 

Detailed Description

Base interface class for Process type plugins.

Constructor & Destructor Documentation

◆ GmProcess()

GmProcess::GmProcess ( GmSimulationData * simulation,
QString id,
QString description,
const GmLogCategory & logger )

Constructor.

Parameters
simulationReference to the simulation object.
idProcess id.
descriptionProcess description.
loggerPlugin logger object used to emmit messages

Member Function Documentation

◆ buildFunctionList()

template<class T >
QStringList GmProcess::buildFunctionList ( typename GmProcessMethodRedirector< T >::MethodRegistry * methods) const
inlineprotected

Helper function to make it very easy to implement functionList() and keep it consistent with loadFunctions().

In functionList(), just call this function passing as parameter the same table passed to registerFunctions() by loadFunctions().

◆ loadPrivateData()

bool GmProcess::loadPrivateData ( LuaTable & table)
virtual

In general, processes dont have any configuration data on the simulation file.

Implements GmPluginObject.

◆ pluginCategory()

virtual const char * GmProcess::pluginCategory ( ) const
inlinevirtual

Returns the plugin category.

Implements GmPluginObject.

◆ printParameters()

void GmProcess::printParameters ( const GmLogCategory & logger)
virtual

Asks the process to print all of its parameters using the provided logger.

The default implementation logs the data, as seen through the access interface;

Implements GmPluginObject.

◆ registerFunctions()

template<class T >
void GmProcess::registerFunctions ( LuaTable & table,
typename GmProcessMethodRedirector< T >::MethodRegistry * methods,
bool noProgressStats = false )
inlineprotected

Helper function to make it very easy to implement loadFunctions()

In loadFuntions(), just define a static table with the name <--> method mapping and call registerFunctions(). See GmpIoProcess::loadFunctions() for an example. Remember that the table must be NULL terminated and static. If noProgressStats is set to true, time statistics will be skipped.


The documentation for this class was generated from the following files: